﻿using HK.Core.Common;
using HK.Core.Utils;

namespace HK.Core.Load.Protocol.Data
{
    /// <summary>
    /// 接口 : Entity对象
    /// </summary>
    public interface IEntityInfo : IAssetBase
    {
        /// <summary>
        /// 实例Id
        /// </summary>
        int InstanceId { get; }
        
        /// <summary>
        /// AssetKey
        /// </summary>
        string AssetKey { get; }
        
        /// <summary>
        /// 资产类型
        /// </summary>
        AssetFileType AssetType { get; }
    }

    /// <summary>
    /// 接口 : Entity对象
    /// </summary>
    /// <typeparam name="TEntity">实例类型</typeparam>
    public interface IEntityInfo<TEntity> : IEntityInfo
        where TEntity : UnityEngine.Object
    {
        /// <summary>
        /// 实例化对象
        /// </summary>
        TEntity Entity { get; }

        /// <summary>
        /// 设定Entity
        /// </summary>
        /// <param name="iEntity">Entity</param>
        /// <param name="iInstanceId">实例Id</param>
        /// <param name="iFrom">加载来源</param>
        void SetEntity(TEntity iEntity, int iInstanceId, LoadFrom iFrom);
    }
}
